Crate memmem

Source
Expand description

A crate for string searching. The main trait is Searcher, which has a function for finding fixed things in long byte-strings. Currently, the only implementer of Searcher is TwoWaySearcher.

§Example

use memmem::{Searcher, TwoWaySearcher};
let search = TwoWaySearcher::new("dog".as_bytes());
assert_eq!(search.search_in("The quick brown fox jumped over the lazy dog.".as_bytes()), Some(41));

Structs§

  • Searches for a substring using the “two-way” algorithm of Crochemore and Perrin, D.

Traits§

  • A trait that searches for patterns in byte-strings.